
import java.io.*;

public class Test {
	public static void main(String... args) throws IOException{
		caesar.CaesarEncode out = new caesar.CaesarEncode(new FileOutputStream("enc.dat") , 3);		// Create encode File
		caesar.CaesarDecode code = new caesar.CaesarDecode(new FileInputStream("enc.dat") , 3);		// Read and decode File
		FileInputStream in = new FileInputStream("enc.dat");							// Read File 1:1

		BufferedInputStream con = new BufferedInputStream(System.in);					// Read From Console
		StringBuilder s= new StringBuilder("");
		System.out.println("Eingabe:");
		while(con.available() > 0 || s.toString().equals(""))
			s.append((char)con.read());
		
		
		out.write(s.toString());
		out.close();
		System.out.println("Codiert:");
		while(in.available() > 0)
			System.out.print((char)in.read());
		System.out.println("Decodiert:");
		while(code.available() > 0)
			System.out.print((char)code.read());
		
	}
}
